﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XB.Core.MemoryStore.MemoryStore;
using XB.Core.MemoryStore.TaskTimer;

namespace MemoryStore.Core.Test
{
    public class TestMemoryStore : IMemoryStore
    {
        private string _name;
        private ITaskTimer _timer;
        public int Level
        {
            get
            {
                return 1;
            }
        }

        public string Name
        {
            get
            {
                return _name;
            }
        }

        public TestMemoryStore(string name, int interval)
        {
            _name = name;
            _timer = new CountdownTimer(interval);
        }

        public ITaskTimer Timer
        {
            get
            {
                return _timer;
            }
        }

        public void Refresh()
        {
            System.Diagnostics.Debug.WriteLine(string.Format("{0} refresed, time is: {1}", _name, DateTime.Now));
        }
    }
}
